home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_300
/
300_01
/
mat_v2d.abr
< prev
next >
Wrap
Text File
|
1989-12-28
|
28KB
|
588 lines
ABREVIATED USERS MANUAL
The following function description is an example of the function writeups
provided in the users manual. The remaining descriptive writeups are very
brief but do describe the syntax and basic use of each function. Regular
users of this library will find the manual quite helpful.
----------------------------------------------------------------------------
mfput
----------------------------------------------------------------------------
Name mfput - Outputs selected columns from floating point array
in formatted pages with column titles
Usage void mfput ( FILE *FN,struct fmat *mtx,char hdr_lst[],
char sel_lst[], unsigned ChPrLn,unsigned FldPrLn,unsigned
DcPlc);
Prototype in mat_v2b.h
Description This function outputs selected columns of the floating
point array mtx to FN, which has previously been opened
for text write operations (see mfcreat).
hdr_lst[] is a list of abbreviated titles (tokens
delimited by spaces) for each column in mtx. sel_lst[] is
list of matching abbreviated titles for the columns which
are to be output. ChPrLn is the maximum number of
characters per line desired. FldPrLn is the number of
values which are desired on each line, and DcPlc specifies
the number of decimal places desired in the output values.
The columns to be output are selected by performing a
token by token comparison of hdr_lst and sel_lst. If an
abreviated title token from sel_lst matches a title token
in hdr_lst, that column will be output. The selected
columns of mtx are output in tabular form without page
breaks with the abbreviated column titles enclosed in
braces at the beginning of the table.
If the numeric output format is not possible with the
number of decimal places (DcPlc) and fields per line
(FldPrLn) specified the function will generate an error
message and terminate execution.
Return value The value of one is returned on completion.
Source code in fmx1_v2b.c
See also mfpgput,mtput
Example /* matrix
[ 1 2 3 4
4 5 6 7
7 8 9 10 ]
*/
flcreat("DATA.OUT",FN);
mfput(FN,matrix, "COL_A COL_B COL_C COL_D",
"COL_B COL_D",20,2,3);
/* The following output will be directed to FN
{ DATA.OUT 12/1/88 }
{
COL_B COL_D
}
2.000 4.000
5.000 7.000
8.000 10.000
ABREVIATED DESCRIPTIONS
----------------------------------------------------------------------------
all
----------------------------------------------------------------------------
Name all - Macro to loop through an entire array
Usage macro as follows: all(mx,rw,cl)
for (rw=0; rw<no_rows(mx); rw++)
for (cl=0; cl<no_cols(mx); cl++)
----------------------------------------------------------------------------
cols
----------------------------------------------------------------------------
Name cols - Macro to loop through an entire array by columns
Usage macro as follows:
cols(mx,cl) for(cl=0;cl<no_cols(mx);cl++)
----------------------------------------------------------------------------
f
----------------------------------------------------------------------------
Name f - Macro to access a dynamic floating array value
Usage float f ( struct fmat *mtx, unsigned row,
unsigned column );
----------------------------------------------------------------------------
fck
----------------------------------------------------------------------------
Name fck - Macro to perform a boundary check on a specified set
of array indexes for a previosly declared floating
point dynamic matrix.
Usage void fck(struct fmat *mtx, unsigned row, unsigned col);
----------------------------------------------------------------------------
fdim
----------------------------------------------------------------------------
Name fdim - Macro to allocate storage and initialize a dynamic
floating point array
Usage void fdim ( struct fmat *mtx, unsigned rows,
unsigned cols );
----------------------------------------------------------------------------
frel
----------------------------------------------------------------------------
Name frel - Macro to deallocate storage previously allocated by
a call to fdim.
Usage void frel(struct fmat *mtx);
----------------------------------------------------------------------------
flcreat
----------------------------------------------------------------------------
Name flcreat - Opens a text file for write operations then
writes a single line containing the filename and date
enclosed in braces
Usage void flcreat ( char filename[],FILE *FN );
----------------------------------------------------------------------------
ft
----------------------------------------------------------------------------
Name ft - Stores a floating point value in a text array as an
ASCII token string.
Usage void ft (struct tmat *mtx,unsigned line,unsigned token,
float value, unsigned ChPrLn,unsigned FldPrLn,
unsigned DcPlc);
----------------------------------------------------------------------------
it
----------------------------------------------------------------------------
Name it - Stores an integer value in a text array as a
token.
Usage void it (struct tmat *mtx,unsigned line,unsigned token,
unsigned value, unsigned ChPrLn,unsigned FldPrLn);
----------------------------------------------------------------------------
mfcnt
----------------------------------------------------------------------------
Name mfcnt - Returns the number of rows and columns in an ASCII
textfile stored in a format standardized for floating
point arrays.
Usage void mfcnt (char filename[], unsigned *rows,
unsigned *cols );
-----------------------------------------------------------------------------
mfcof
-----------------------------------------------------------------------------
Name mfcof - Returns the cofactor for a dynamic floating point
array element.
Usage float mfcof (struct fmat *mtx,unsigned i, unsigned j);
----------------------------------------------------------------------------
mfcnt
----------------------------------------------------------------------------
Name mfcnt - Returns the number of rows and columns in an